<!DOCTYPE html>
<html xmlns:th="http://www.thymeleaf.org">
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<title>卓信微艺人</title>
<!-- Tell the browser to be responsive to screen width -->
<meta content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no" name="viewport">
<link href="static/img/icons/logo_16.ico" mce_href="static/img/icons/logo_16.ico" type="image/x-icon" rel="icon" />

<!-- Bootstrap 3.3.7 -->
<link rel="stylesheet" href="static/bootstrap/css/bootstrap.min.css">
<!-- Font Awesome -->
<link rel="stylesheet" href="static/plugins/font-awesome/css/font-awesome.min.css">
<!-- Ionicons -->
<link rel="stylesheet" href="static/plugins/Ionicons/css/ionicons.min.css">
<!-- Theme style -->
<link rel="stylesheet" href="static/dist/css/AdminLTE.min.css">
<link rel="stylesheet" href="static/plugins/toastr/toastr.min.css">
<!--引入新增的css-->
<link rel="stylesheet" href="static/css/zx-style.css">
  

<!-- HTML5 Shim and Respond.js IE8 support of HTML5 elements and media queries -->
<!-- WARNING: Respond.js doesn't work if you view the page via file:// -->
<!--[if lt IE 9]>
  <script src="https://oss.maxcdn.com/html5shiv/3.7.3/html5shiv.min.js"></script>
  <script src="https://oss.maxcdn.com/respond/1.4.2/respond.min.js"></script>
  <![endif]-->

<!-- Google Font -->
<link rel="stylesheet" href="https://fonts.googleapis.com/css?family=Source+Sans+Pro:300,400,600,700,300italic,400italic,600italic">
<style type="text/css">
	input::-webkit-outer-spin-button,            
	input::-webkit-inner-spin-button{-webkit-appearance: none !important;}
</style>
</head>
<body class="hold-transition zx-login-page" style="height:auto;">
<div class="login-box">
  <div class="login-logo"> 
     <div class="pc-img">
    	  <img src="static/img/system/login-logo.png">
      </div>
      <div class="mobile-img">
      	  <img src="static/img/layout/login-name-m.jpg">
      </div>
  </div>
  <!-- /.login-logo -->
  <div class="login-box-body">
    <div class="system-name">
      <p>卓信微艺人</p>
    </div>
    <div class="form-group has-feedback">
      <input type="number" class="form-control" id="userCode" placeholder="短工号" required>
      <span class="	zxfont icon-user form-control-feedback"></span> </div>
    <div class="form-group has-feedback">
      <input type="password" class="form-control" id="userPasswd" placeholder="密码" required>
      <span class="zxfont icon-password form-control-feedback"></span> </div>
    <div class="row margin-bottom">
      <div class="col-xs-12">
        <button type="button" class="btn btn-primary btn-block btn-lg" onclick="loginSys(this);" style="background-color:#2062db;border-color:#2062db;">登录</button>
      </div>
      <!-- /.col --> 
    </div>
   
    <!--  <a href="#">I forgot my password</a><br>
    <a href="register.html" class="text-center">Register a new membership</a> --> 
    
  </div>
  <!-- /.login-box-body --> 
</div>
<!-- /.login-box --> 

<script src="static/js/zxjs/zx-all.js"></script> 
<script>
  $(function () {
	  $(document).ready(function() { 
		  debugger
	        //Jquery 判断是否移动设备浏览
	        var isMobile = {  
	            Android: function() {  
	                return navigator.userAgent.match(/Android/i) ? true : false;  
	            },  
	            BlackBerry: function() {  
	                return navigator.userAgent.match(/BlackBerry/i) ? true : false;  
	            },  
	            iOS: function() {  
	                return navigator.userAgent.match(/iPhone|iPad|iPod/i) ? true : false;  
	            },  
	            Windows: function() {  
	                return navigator.userAgent.match(/IEMobile/i) ? true : false;  
	            },  
	            any: function() {  
	                return (isMobile.Android() || isMobile.BlackBerry() || isMobile.iOS() || isMobile.Windows());  
	            }  
	        };  
		  
		  	debugger
	        if(isMobile.any())   
	        {  
	            window.location.href=window.location.origin+"/FOl/m/mLogin";                  
	        }  
	    });
    //回车登录
    $(document).keydown(function(event) { 
    	if(event.keyCode == 13) { 
    		loginSys(); 
    	} 
   	}); 
    
  });
  
  var loginSys = function(obj) {
	  if(obj){
		  $(obj).blur();
	  }

		if(globalUtil.isEmpty($('#userCode').val())){		
			toastr.warning("请输入用户名！");
			return false;
		}
		if(globalUtil.isEmpty($('#userPasswd').val())){		
			toastr.warning("请输入密码！");
			return false;
		}
			
		var account = $.trim($('#userCode').val());
		var pwd = $.trim($('#userPasswd').val());
		
		$.post(globalUtil.getTimestampUrl("/sys/login.do"),
					 {"userCode": account, "userPasswd": pwd}, 
					 function(data) {
					 if (data.error) {
						toastr.warning(data.error);
					}else {
						//当登录成功后，重新刷新页面
						window.location.href=global_param.context_name+"/index"
					}
				}
			);
	};

</script>
</body>
</html>
